package com.acme.bankapp.domain.bank.notifications;

import com.acme.bankapp.domain.bank.Client;
import com.acme.bankapp.service.bank.EmailService;

/**
 * Created by Student on 21.11.2014.
 */
public class ClientNotificationEmail implements ClientRegistrationListener {
    private transient EmailService es;

    public ClientNotificationEmail() {
        this.es = new EmailService();
    }

    @Override
    public void onClientAdded(Client c) {
        es.sendNotificationEmail(c);
    }

    @Override
    public void stopListener() {
        es.close();
    }
}
